package com.farmlei.zkt_c3100;

import com.farmlei.zkt_c3100.lock.DoorRecordListener;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component//被spring容器管理
@Order(1)//如果多个自定义ApplicationRunner，用来标明执行顺序
public class MyApplicationRunner implements ApplicationRunner {
    @Override
    public void run(ApplicationArguments applicationArguments) throws Exception {
        System.out.println("-------------->" + "项目启动，当前时间：" + new Date());
        try {
            //初始化中控门禁监听
            DoorRecordListener.getInstance().init();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }


}
